home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / tlx_sq21.zip / CONFLIST.SLT < prev    next >
Text File  |  1992-03-20  |  3KB  |  95 lines

  1. //-----------------------------------------------------------
  2. // CONFLIST.SL? Get Conference list.
  3. //
  4. // Please look at the comments through the whole file, and modify to
  5. // suit your needs, BEFORE you use it. Then recompile with CS CONFLIST.
  6. //-----------------------------------------------------------
  7.  
  8. // If you have suggestions for improving this script, please suggest
  9. // improvements to me via old-fashioned snail-mail to:
  10.  
  11. // Author:  Inge Vabekk
  12. //          Hamangskogen 108
  13. //          N-1300 SANDVIKA
  14. //          NORWAY
  15. //          tel. (472) 546 396
  16.  
  17. str thisBBStype [] = "MBBS"    // This BBS type.      
  18.    ,codename   [8]             // This BBS's codename
  19.    ,line      [80]             // Temporary storage
  20.    ,file      [64]             // Filename
  21.    ,command   [10]="Command:"  // Command prompt
  22.                                // For the Global storage:
  23.    ,global   []="GLOBAL"       // Global script
  24.    ,PutLine  []="PUTLINE"      // Put Line script
  25.    ,BBStype  []="BTYPE"        // BBS type
  26.    ,code     []="CNAME"        // Codename for this BBS
  27.    ,short    []="SHORT"        // Shortened BBS name
  28.    ,prompt   []="PROMPT"       // Current command prompt
  29.    ,newmes   []="NEWMES"       // Directory for new messages
  30.    ,gconflst []="CNFLST"       // Get conference list?
  31.    ;     
  32.  
  33. int tol = 300                  // No activity for 30 sec.
  34.    ,stat, tmark                // makes script time out. 
  35.    ,BBSver                     // MBBS version.
  36.    ,Enter=13                   // Code for CR.
  37.    ;
  38.  
  39. //-----------------------------------------------------------   
  40. // Script starts here.
  41. //-----------------------------------------------------------   
  42.  
  43. main()
  44. {
  45. // Only if online.
  46.  
  47.   if (!carrier())
  48.   { prints ("T²: Sorry -- can't list conferences in offline mode.");
  49.     return (-1);                       // Doesn't match script!
  50.   }
  51.   read (bbstype,codename);             // Get current BBS type.
  52.   if (codename != thisBBStype)  
  53.   { prints ("T²: Sorry -- The CONFLIST script only works with MBBS.");
  54.     return (-1);                       // Doesn't match script!
  55.   }
  56.   read (prompt,command);               // Get current command prompt.
  57.   read (newmes,line);
  58.   read (code,codename);
  59.   strcat (line,codename);
  60.   strcat (line,".LST");
  61.   fdelete (line);                      // Delete old list.
  62.   capture("*CLOSE*");                  // Close current log file.
  63.   capture (line);
  64.  
  65.   call (PutLine,"R SH A",Enter);
  66.   waitfor(command, 20);
  67.   
  68.   capture ("*CLOSE*"); 
  69.  
  70.   file = "LOG\";                       // log file.
  71.   read (short,codename);               // Get name of
  72.   strcat (file,codename);
  73.   capture ("*CLOSE*");                 // Close capture file.
  74.   capture (file);                      // Proceed with the old one.
  75.   write (gconflst,"");                 // Got conference list.
  76. }
  77.  
  78. //-----------------------------------------------------------
  79. // Read a global variable.
  80. //-----------------------------------------------------------
  81.  
  82. read (str name, str varname)
  83. {
  84.   return (call (global,"R",name,varname));
  85. }
  86.  
  87. //-----------------------------------------------------------
  88. // Write a global variable.
  89. //-----------------------------------------------------------
  90.  
  91. write(str name, str varname)
  92.   return (call (global,"W",name,varname));
  93. }
  94.